/* 
 * File:   mem.h
 * Author: gustavo
 *
 * Created on August 17, 2011, 2:49 AM
 */

#ifndef MEM_H
#define	MEM_H

#include <stdlib.h>

#ifdef	__cplusplus
extern "C" {
#endif

#define mp_alloc(type) (type *) calloc( 1, sizeof(type) )
#define mp_allocn(n, type) (type *) calloc( (n), sizeof(type) )
#define mp_free(p) { if(p) {free(p); p = NULL;} }


#ifdef	__cplusplus
}
#endif

#endif	/* MEM_H */

